<!DOCTYPE HTML> 
<html> 
<head> 
<meta http-equiv="content-Type" content="text/html; charset=utf-8" /> 
<title>Exam4j</title>
<link href="${basePath}/css/css-base.css" rel="stylesheet" type="text/css" />
<style>

body{
	font: 14px/30px "Lucida Grande", "Lucida Sans Unicode","\5FAE\8F6F\96C5\9ED1", Arial, Verdana, sans-serif ;
	-moz-user-select:none;
}

.top{
	width:100%;
	height:30px;
	border-bottom:1px solid #DBE5F1;
	font-size:14px;
}
.header{
	margin:0 auto;
	width:962px;
}

.footer{
	width:100%;
	bottom:0;
	height:30px;
	border-top:1px solid #DBE5F1;
	font-size:14px;
	position:absolute;
}
.top li a:{float:left;margin:4px;_margin-top: 8px;line-height: 31px;font-weight:bold}
.top li a:link {color:#868686;text-decoration:none;}
.top li a:visited {color:#868686;text-decoration:none;}
.top li a:hover {color:#C70707;}

.nav{float:left;}
.nav li {display:inline;margin:0 10px;}


.menu{float:right;text-align:center}
.menu li {display:inline;padding: 4px 8px;}

.container{
	margin:0 auto;
	width:960px;

}

.addquestion_box{
	border:5px solid #DBE5F1;
	margin:50px 0;
	
}

.addquestion_box input,select{
	border:2px solid #DBE5F1;
	height:30px;
	width:300px;
	font-size:25px;
	
}

.addquestion_box select{
	width:190px;
	
}

table{
	font: 28px/70px Arial, Verdana, sans-serif;
	border-collapse:collapse;
	margin:50px;
	color:#626262;
	
}
td{
	padding-left:15px;
	text-align:center;
	
}
th{

	border-collapse:collapse;
	text-align:center;
	font-weight:bold;
	text-align:left;
}

table a{
	font-size:12px;
}

a { margin-left:5px; color:#07F; text-decoration:none; }
a:hover { text-decoration:underline; }

.btn_tr td{
	padding-top:120px;
}
.btn_tr a{
	width:300px;
	height:40px;
	background-color:#DBE5F1;
	border:0;
	margin:10px;
	text-align:center;
	font-size:28px;
	display:block;
	line-height:40px;
	font-weight:bold;
}

.btn_tr a:link {color:#868686;text-decoration:none;}
.btn_tr a:visited {color:#868686;text-decoration:none;}
.btn_tr a:hover {background-color:#94B1D6;color:white;font-size:26px;}
</style> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}/js/jquery.EasyInsert-4.0.min.js"></script>
<script>
$(document).ready(function(){
	<#if (paperId??)>
	$("#paperId").val("${paperId}");
	</#if>

	
	$("#anwserList").easyinsert({
		name: ["anwsers","custom"],
		type: ["text","custom"],
		value:["","<input type=\"checkbox\" name=\"corrects\" value=\"\" title=\"此项为正确答案\"/>"]
	});
	
	$("#btn_submit").click(function(){
		$.each($("input[name=corrects]"), function(i, n){
			$(n).val(i);
		});
		
		$.post("${basePath}/dashboard/question/doAddQuestion.do",$("#theForm").serialize(),function(responseText)
        {
            location.href="${basePath}/index.do";
        },"text");
	});
	
	$("#btn_goon").click(function(){
		$.each($("input[name=corrects]"), function(i, n){
			$(n).val(i);
		});
		
		$.post("${basePath}/dashboard/question/doAddQuestion.do",$("#theForm").serialize(),function(responseText)
        {
        	alert("创建成功,请继续");
            $("#theForm").each(function() {   
			   this.reset();   
			  });
        },"text");
	});
});
</script>
</head>
<body>
	<div class="top">
		<div class="header">
			<ul class="nav">
				<li><a href="${basePath}/index.do" class="current">首页</a></li>
				<li><a href="${basePath}/radom.do">随便看看</a></li>
				<li>分类</li>
			</ul>
			<ul class="menu">
				<li><a href="${basePath}/profile.do">档案</a></li>
				<li><a href="${basePath}/login/doLogout.do">退出</a></li>
			</ul>
		</div>
	</div>
	
	<div class="container">
		<div class="addquestion_box br4">
			<form id="theForm" method="post" action="">
				<ul>
					<li>
						<table>
							<tr>
								<th>问题类型：</th>
								<td>
									<select name="questionType">
										<#list typeList as type>
										<option value="${type.uid}">${type.typeName}</option>
										</#list>
									</select>
								</td>
								
								<th>所属试卷：</th>
								<td>
									<select name="paperId">
										<#list paperList as paper>
											<option value="${paper.uid}">${paper.title}</option>
										</#list>
									</select>
								</td>
							</tr>
							
							<tr>
								<th>分值：</th>
								<td>
									<input id="score" name="score" type="text" maxlength="3" style="width:190px;"/>
								</td>
								
								<th>顺序：</th>
								<td>
									<input id="questionNumber" name="questionNumber" type="text" maxlength="3" style="width:190px;"/>
								</td>
							</tr>
							<tr>
								<th>问题引言：</th>
								<td colspan="3"><input id="preQuestion" name="preQuestion" type="text" value="" style="width:590px;"/></td>
							</tr>
							<tr>
								<th>问题：</th>
								<td colspan="3"><input id="question" name="question" type="text" value="" style="width:590px;"/></td>
							</tr>
							<tr>
								<th>候选答案：</th>
								<td colspan="3" rowspan="2" style="border:1px solid #DBE5F1;padding:10px;">
									<ul id="anwserList"></ul>
									<a href="#">+ 添加</a>
								</td>
							</tr>
							
							<tr>
								<td></td>
							<tr>
							
							<tr class="btn_tr">
								<td colspan="2"><a id="btn_submit" href="javascript:void(0);" class="br8">创建</a></td>
								<td colspan="2"><a id="btn_goon" href="javascript:void(0);" class="br8">创建并继续</a></td>
							<tr>
						</table>
					</li>
					
				</ul>
			</form>
		</div>
	</div>
</body>
</html>